<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//前台-首页
Route::get('/', 'IndexController@index');

//开发者登录、注册、验证码
Route::group(['namespace' => 'Admin','prefix' => 'charge','middleware' => ['web']], function () {
    Route::any('login.html','RegLoginController@login'); //登录
    Route::get('reg.html','RegLoginController@reg'); //注册
    Route::post('reg_post.html','RegLoginController@reg_post'); //注册提交
    Route::get('yzm.html','RegLoginController@yzm'); //验证码
});


//开发者后台管理
Route::group(['namespace' => 'Admin','prefix' => 'charge','middleware' => ['web','admin.login']], function () {

    Route::get('index.html','IndexController@index'); //首页
    Route::get('logout.html','IndexController@logout');//注销

    Route::get('info.html','InfoController@index'); //用户信息
    Route::post('info/update.html','InfoController@update'); //用户信息修改
    Route::post('info/changepassword.html','InfoController@changePassword'); //用户密码修改

    Route::get('device.html','DeviceController@index'); //设备管理
    Route::get('device/qrcode.html','DeviceController@qrCode'); //设备二维码
    Route::get('addDevice.html','AddDeviceController@index'); //添加设备
    Route::post('device/add.html','AddDeviceController@add'); //添加设备

    Route::get('message.html','MessageController@index'); //消息

});